home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news text
| default
| |
99%
| file
| C source text
| default
| |
98%
| file
| C source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 72 65 | 64 2e 77 65 65 67 2e 75 |Path: re|d.weeg.u|
|00000010| 69 6f 77 61 2e 65 64 75 | 21 72 6f 62 69 6e 73 6f |iowa.edu|!robinso|
|00000020| 6e 0a 46 72 6f 6d 3a 20 | 54 68 65 20 41 6d 6f 72 |n.From: |The Amor|
|00000030| 70 68 6f 75 73 20 4d 61 | 73 73 20 3c 72 6f 62 69 |phous Ma|ss <robi|
|00000040| 6e 73 6f 6e 40 62 6c 75 | 65 2e 77 65 65 67 2e 75 |nson@blu|e.weeg.u|
|00000050| 69 6f 77 61 2e 65 64 75 | 3e 0a 4e 65 77 73 67 72 |iowa.edu|>.Newsgr|
|00000060| 6f 75 70 73 3a 20 63 6f | 6d 70 2e 6c 61 6e 67 2e |oups: co|mp.lang.|
|00000070| 63 0a 53 75 62 6a 65 63 | 74 3a 20 52 65 3a 20 50 |c.Subjec|t: Re: P|
|00000080| 72 6f 62 6c 65 6d 20 77 | 69 74 68 20 63 20 63 6f |roblem w|ith c co|
|00000090| 64 65 2c 20 70 6c 65 61 | 73 65 20 68 65 6c 70 21 |de, plea|se help!|
|000000a0| 0a 44 61 74 65 3a 20 46 | 72 69 2c 20 31 39 20 4a |.Date: F|ri, 19 J|
|000000b0| 61 6e 20 31 39 39 36 20 | 31 39 3a 33 37 3a 31 31 |an 1996 |19:37:11|
|000000c0| 20 2d 30 36 30 30 0a 4f | 72 67 61 6e 69 7a 61 74 | -0600.O|rganizat|
|000000d0| 69 6f 6e 3a 20 55 6e 69 | 76 65 72 73 69 74 79 20 |ion: Uni|versity |
|000000e0| 6f 66 20 49 6f 77 61 2c | 20 49 6f 77 61 20 43 69 |of Iowa,| Iowa Ci|
|000000f0| 74 79 2c 20 49 41 2c 20 | 55 53 41 0a 44 69 73 74 |ty, IA, |USA.Dist|
|00000100| 72 69 62 75 74 69 6f 6e | 3a 20 77 6f 72 6c 64 0a |ribution|: world.|
|00000110| 4d 65 73 73 61 67 65 2d | 49 44 3a 20 3c 50 69 6e |Message-|ID: <Pin|
|00000120| 65 2e 41 33 32 2e 33 2e | 39 31 2e 39 36 30 31 31 |e.A32.3.|91.96011|
|00000130| 39 31 39 30 35 32 31 2e | 31 33 31 33 33 36 45 2d |9190521.|131336E-|
|00000140| 31 30 30 30 30 30 40 62 | 6c 61 63 6b 2e 77 65 65 |100000@b|lack.wee|
|00000150| 67 2e 75 69 6f 77 61 2e | 65 64 75 3e 0a 4e 4e 54 |g.uiowa.|edu>.NNT|
|00000160| 50 2d 50 6f 73 74 69 6e | 67 2d 48 6f 73 74 3a 20 |P-Postin|g-Host: |
|00000170| 72 65 64 2e 77 65 65 67 | 2e 75 69 6f 77 61 2e 65 |red.weeg|.uiowa.e|
|00000180| 64 75 0a 4d 69 6d 65 2d | 56 65 72 73 69 6f 6e 3a |du.Mime-|Version:|
|00000190| 20 31 2e 30 0a 43 6f 6e | 74 65 6e 74 2d 54 79 70 | 1.0.Con|tent-Typ|
|000001a0| 65 3a 20 54 45 58 54 2f | 50 4c 41 49 4e 3b 20 63 |e: TEXT/|PLAIN; c|
|000001b0| 68 61 72 73 65 74 3d 55 | 53 2d 41 53 43 49 49 0a |harset=U|S-ASCII.|
|000001c0| 58 2d 53 65 6e 64 65 72 | 3a 20 72 6f 62 69 6e 73 |X-Sender|: robins|
|000001d0| 6f 6e 40 72 65 64 2e 77 | 65 65 67 2e 75 69 6f 77 |on@red.w|eeg.uiow|
|000001e0| 61 2e 65 64 75 0a 49 6e | 2d 52 65 70 6c 79 2d 54 |a.edu.In|-Reply-T|
|000001f0| 6f 3a 20 3c 73 75 72 67 | 73 77 2d 31 39 30 31 39 |o: <surg|sw-19019|
|00000200| 36 30 31 34 38 35 33 30 | 30 30 31 40 31 32 38 2e |60148530|001@128.|
|00000210| 32 30 36 2e 32 30 36 2e | 38 36 3e 20 0a 0a 4f 6e |206.206.|86> ..On|
|00000220| 20 46 72 69 2c 20 31 39 | 20 4a 61 6e 20 31 39 39 | Fri, 19| Jan 199|
|00000230| 36 2c 20 4a 6f 65 6c 20 | 57 65 69 6e 73 74 65 69 |6, Joel |Weinstei|
|00000240| 6e 20 77 72 6f 74 65 3a | 0a 0a 3e 20 49 20 68 61 |n wrote:|..> I ha|
|00000250| 76 65 20 62 65 65 6e 20 | 74 72 79 69 6e 67 20 74 |ve been |trying t|
|00000260| 6f 20 67 65 74 20 74 68 | 69 73 20 76 65 72 79 20 |o get th|is very |
|00000270| 73 69 6d 70 6c 65 20 70 | 69 65 63 65 20 6f 66 20 |simple p|iece of |
|00000280| 63 6f 64 65 20 74 6f 20 | 77 6f 72 6b 20 66 6f 72 |code to |work for|
|00000290| 0a 3e 20 68 6f 75 72 73 | 2e 20 20 57 68 61 74 20 |.> hours|. What |
|000002a0| 69 73 20 74 68 65 20 70 | 72 6f 62 6c 65 6d 3f 3f |is the p|roblem??|
|000002b0| 3f 3f 3f 3f 3f 0a 3e 20 | 0a 3e 20 23 69 6e 63 6c |?????.> |.> #incl|
|000002c0| 75 64 65 20 3c 73 74 64 | 69 6f 2e 68 3e 0a 3e 20 |ude <std|io.h>.> |
|000002d0| 0a 3e 20 6d 61 69 6e 28 | 29 0a 0a 20 20 54 68 69 |.> main(|).. Thi|
|000002e0| 73 20 69 73 20 63 6f 72 | 72 65 63 74 2c 20 62 75 |s is cor|rect, bu|
|000002f0| 74 20 6d 61 79 20 63 61 | 75 73 65 20 79 6f 75 20 |t may ca|use you |
|00000300| 74 72 6f 75 62 6c 65 20 | 69 6e 20 74 68 65 20 63 |trouble |in the c|
|00000310| 61 73 65 20 6f 66 20 61 | 20 74 79 70 6f 20 6c 69 |ase of a| typo li|
|00000320| 6b 65 0a 0a 73 74 72 75 | 63 74 20 66 6f 6f 20 7b |ke..stru|ct foo {|
|00000330| 0a 20 20 20 69 6e 74 20 | 62 61 72 3b 0a 7d 0a 0a |. int |bar;.}..|
|00000340| 6d 61 69 6e 28 29 20 20 | 2f 2a 20 63 6f 6d 70 69 |main() |/* compi|
|00000350| 6c 65 72 20 74 68 69 6e | 6b 73 20 6d 61 69 6e 20 |ler thin|ks main |
|00000360| 72 65 74 75 72 6e 73 20 | 73 74 72 75 63 74 20 66 |returns |struct f|
|00000370| 6f 6f 21 20 2a 2f 0a 0a | 0a 20 20 49 74 27 73 20 |oo! */..|. It's |
|00000380| 73 61 66 65 72 20 74 6f | 20 65 78 70 6c 69 63 69 |safer to| explici|
|00000390| 74 6c 79 20 64 65 63 6c | 61 72 65 20 69 74 20 61 |tly decl|are it a|
|000003a0| 73 20 69 6e 74 20 6d 61 | 69 6e 28 76 6f 69 64 29 |s int ma|in(void)|
|000003b0| 2e 0a 0a 3e 20 7b 0a 3e | 20 20 20 20 69 6e 74 20 |...> {.>| int |
|000003c0| 69 3d 30 3b 0a 0a 20 20 | 69 6e 74 20 69 20 3d 20 |i=0;.. |int i = |
|000003d0| 30 2c 0a 20 20 20 20 20 | 20 63 3b 20 20 20 20 20 |0,. | c; |
|000003e0| 20 2f 2a 20 67 65 74 63 | 68 61 72 28 29 20 72 65 | /* getc|har() re|
|000003f0| 74 75 72 6e 73 20 69 6e | 74 2e 20 20 41 73 73 69 |turns in|t. Assi|
|00000400| 67 6e 69 6e 67 20 69 74 | 73 20 76 61 6c 75 65 20 |gning it|s value |
|00000410| 74 6f 20 61 20 63 68 61 | 72 20 63 61 6e 0a 20 20 |to a cha|r can. |
|00000420| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 72 | | r|
|00000430| 65 73 75 6c 74 20 69 6e | 20 79 6f 75 72 20 6e 6f |esult in| your no|
|00000440| 74 20 62 65 69 6e 67 20 | 61 62 6c 65 20 74 6f 20 |t being |able to |
|00000450| 64 65 74 65 63 74 20 65 | 67 2e 20 45 4f 46 20 2a |detect e|g. EOF *|
|00000460| 2f 0a 0a 3e 20 20 20 20 | 63 68 61 72 20 20 77 6f |/..> |char wo|
|00000470| 72 64 5b 31 30 30 5d 2c | 20 63 3b 0a 0a 63 68 61 |rd[100],| c;..cha|
|00000480| 72 20 77 6f 72 64 5b 31 | 30 30 5d 3b 0a 0a 3e 20 |r word[1|00];..> |
|00000490| 20 20 20 70 72 69 6e 74 | 66 28 22 45 6e 74 65 72 | print|f("Enter|
|000004a0| 20 61 20 77 6f 72 64 3a | 20 20 20 22 29 3b 0a 3e | a word:| ");.>|
|000004b0| 20 20 20 20 77 68 69 6c | 65 28 20 28 63 20 3d 20 | whil|e( (c = |
|000004c0| 67 65 74 63 68 61 72 28 | 29 29 20 21 3d 20 27 5c |getchar(|)) != '\|
|000004d0| 6e 27 29 20 20 7b 0a 3e | 20 20 20 20 20 20 20 2a |n') {.>| *|
|000004e0| 77 6f 72 64 20 3d 20 63 | 3b 0a 3e 20 20 20 20 20 |word = c|;.> |
|000004f0| 20 20 77 6f 72 64 20 3d | 3d 20 77 6f 72 64 20 2b | word =|= word +|
|00000500| 20 31 3b 0a 3e 20 20 20 | 20 7d 20 20 0a 0a 20 20 | 1;.> | } .. |
|00000510| 59 6f 75 27 72 65 20 63 | 6f 6e 66 75 73 69 6e 67 |You're c|onfusing|
|00000520| 20 70 6f 69 6e 74 65 72 | 73 20 61 6e 64 20 61 72 | pointer|s and ar|
|00000530| 72 61 79 73 2e 20 20 77 | 6f 72 64 2b 2b 20 61 6e |rays. w|ord++ an|
|00000540| 64 20 77 6f 72 64 20 3d | 20 77 6f 72 64 20 2b 20 |d word =| word + |
|00000550| 31 20 64 6f 6e 27 74 20 | 0a 77 6f 72 6b 20 62 65 |1 don't |.work be|
|00000560| 63 61 75 73 65 20 69 74 | 20 64 6f 65 73 6e 27 74 |cause it| doesn't|
|00000570| 20 6d 61 6b 65 20 61 6e | 79 20 73 65 6e 73 65 20 | make an|y sense |
|00000580| 66 6f 72 20 74 68 65 6d | 20 74 6f 3a 20 20 77 6f |for them| to: wo|
|00000590| 72 64 20 69 73 20 6e 6f | 74 20 61 20 70 6f 69 6e |rd is no|t a poin|
|000005a0| 74 65 72 2c 20 0a 69 74 | 27 73 20 61 6e 20 61 72 |ter, .it|'s an ar|
|000005b0| 72 61 79 20 61 6e 64 20 | 69 74 20 64 6f 65 73 6e |ray and |it doesn|
|000005c0| 27 74 20 6d 65 61 6e 20 | 61 6e 79 74 68 69 6e 67 |'t mean |anything|
|000005d0| 20 74 6f 20 22 69 6e 63 | 72 65 6d 65 6e 74 20 61 | to "inc|rement a|
|000005e0| 6e 20 61 72 72 61 79 2e | 22 20 20 54 68 65 20 0a |n array.|" The .|
|000005f0| 73 69 6d 70 6c 65 73 74 | 20 63 68 61 6e 67 65 20 |simplest| change |
|00000600| 79 6f 75 20 63 61 6e 20 | 6d 61 6b 65 20 69 73 20 |you can |make is |
|00000610| 74 6f 20 74 72 65 61 74 | 20 77 6f 72 64 20 61 73 |to treat| word as|
|00000620| 20 61 6e 20 61 72 72 61 | 79 20 28 73 69 6e 63 65 | an arra|y (since|
|00000630| 20 69 74 20 69 73 20 0a | 6f 6e 65 29 2e 20 20 4e | it is .|one). N|
|00000640| 6f 74 65 20 74 68 61 74 | 20 49 20 61 64 64 65 64 |ote that| I added|
|00000650| 20 74 68 65 20 63 6f 6d | 70 61 72 69 73 6f 6e 20 | the com|parison |
|00000660| 77 69 74 68 20 45 4f 46 | 20 74 6f 20 73 74 6f 70 |with EOF| to stop|
|00000670| 20 61 63 63 65 70 74 69 | 6e 67 20 69 6e 70 75 74 | accepti|ng input|
|00000680| 20 0a 69 6e 20 74 68 65 | 20 65 76 65 6e 74 20 6f | .in the| event o|
|00000690| 66 20 61 6e 20 65 72 72 | 6f 72 2c 20 61 6e 64 20 |f an err|or, and |
|000006a0| 74 68 65 20 63 6f 6d 70 | 61 72 69 73 6f 6e 20 6f |the comp|arison o|
|000006b0| 66 20 69 20 77 69 74 68 | 20 39 38 20 74 6f 20 6b |f i with| 98 to k|
|000006c0| 65 65 70 20 74 68 65 20 | 0a 70 72 6f 67 72 61 6d |eep the |.program|
|000006d0| 20 66 72 6f 6d 20 77 72 | 69 74 69 6e 67 20 70 61 | from wr|iting pa|
|000006e0| 73 74 20 74 68 65 20 65 | 6e 64 20 6f 66 20 74 68 |st the e|nd of th|
|000006f0| 65 20 61 72 72 61 79 3a | 0a 0a 69 6e 74 20 69 20 |e array:|..int i |
|00000700| 3d 20 30 3b 0a 77 68 69 | 6c 65 20 28 28 63 20 3d |= 0;.whi|le ((c =|
|00000710| 20 67 65 74 63 68 61 72 | 28 29 29 20 21 3d 20 45 | getchar|()) != E|
|00000720| 4f 46 20 26 26 20 63 20 | 21 3d 20 27 5c 6e 27 20 |OF && c |!= '\n' |
|00000730| 26 26 20 69 20 3c 20 39 | 38 29 0a 20 20 20 20 77 |&& i < 9|8). w|
|00000740| 6f 72 64 5b 69 2b 2b 5d | 20 3d 20 63 3b 0a 77 6f |ord[i++]| = c;.wo|
|00000750| 72 64 5b 69 5d 20 3d 20 | 27 5c 30 27 3b 20 20 2f |rd[i] = |'\0'; /|
|00000760| 2a 20 6e 75 6c 20 74 65 | 72 6d 69 6e 61 74 65 20 |* nul te|rminate |
|00000770| 74 68 65 20 75 73 65 72 | 27 73 20 69 6e 70 75 74 |the user|'s input|
|00000780| 20 2a 2f 0a 0a 3e 20 20 | 20 20 70 72 69 6e 74 66 | */..> | printf|
|00000790| 28 22 59 6f 75 20 65 6e | 74 65 72 65 64 3a 20 20 |("You en|tered: |
|000007a0| 22 29 3b 20 20 0a 3e 20 | 20 20 20 2a 77 6f 72 64 |"); .> | *word|
|000007b0| 20 3d 20 30 3b 0a 0a 3f | 3f 3f 20 20 42 6c 6f 77 | = 0;..?|?? Blow|
|000007c0| 20 74 68 69 73 20 6c 69 | 6e 65 20 61 77 61 79 2e | this li|ne away.|
|000007d0| 20 20 49 74 20 64 6f 65 | 73 6e 27 74 20 6d 61 6b | It doe|sn't mak|
|000007e0| 65 20 61 6e 79 20 73 65 | 6e 73 65 2e 0a 0a 3e 20 |e any se|nse...> |
|000007f0| 20 20 20 77 68 69 6c 65 | 28 20 2a 77 6f 72 64 20 | while|( *word |
|00000800| 21 3d 20 27 5c 6e 27 20 | 29 20 20 20 0a 3e 20 20 |!= '\n' |) .> |
|00000810| 20 20 7b 20 20 0a 3e 20 | 20 20 20 20 20 20 70 75 | { .> | pu|
|00000820| 74 63 68 61 72 28 20 2a | 77 6f 72 64 20 29 3b 0a |tchar( *|word );.|
|00000830| 3e 20 20 20 20 20 20 20 | 77 6f 72 64 20 3d 3d 20 |> |word == |
|00000840| 77 6f 72 64 20 2b 20 31 | 3b 20 0a 3e 20 20 20 20 |word + 1|; .> |
|00000850| 7d 0a 3e 20 7d 20 20 0a | 0a 20 20 42 75 74 20 79 |}.> } .|. But y|
|00000860| 6f 75 20 73 70 65 63 69 | 66 69 63 61 6c 6c 79 20 |ou speci|fically |
|00000870| 74 6f 6c 64 20 69 74 20 | 74 6f 20 73 74 6f 70 20 |told it |to stop |
|00000880| 77 68 65 6e 20 69 74 20 | 65 6e 63 6f 75 6e 74 65 |when it |encounte|
|00000890| 72 73 20 61 20 27 5c 6e | 27 2c 20 73 6f 20 0a 74 |rs a '\n|', so .t|
|000008a0| 68 65 72 65 20 77 69 6c | 6c 20 6e 65 76 65 72 20 |here wil|l never |
|000008b0| 62 65 20 6f 6e 65 20 69 | 6e 20 77 6f 72 64 21 20 |be one i|n word! |
|000008c0| 20 54 68 61 74 27 73 20 | 77 68 79 20 49 20 6e 75 | That's |why I nu|
|000008d0| 6c 20 74 65 72 6d 69 6e | 61 74 65 64 20 74 68 65 |l termin|ated the|
|000008e0| 20 0a 73 74 72 69 6e 67 | 20 61 66 74 65 72 20 6d | .string| after m|
|000008f0| 79 20 76 65 72 73 69 6f | 6e 20 2d 2d 20 74 6f 20 |y versio|n -- to |
|00000900| 73 65 74 20 61 6e 20 65 | 61 73 69 6c 79 20 64 65 |set an e|asily de|
|00000910| 74 65 63 74 65 64 20 6d | 61 72 6b 20 66 6f 72 20 |tected m|ark for |
|00000920| 65 6e 64 20 6f 66 20 69 | 6e 70 75 74 2e 0a 0a 54 |end of i|nput...T|
|00000930| 72 79 20 69 6e 73 74 65 | 61 64 3a 0a 0a 77 68 69 |ry inste|ad:..whi|
|00000940| 6c 65 28 77 6f 72 64 5b | 69 5d 29 20 20 0a 20 20 |le(word[|i]) . |
|00000950| 20 20 70 75 74 63 68 61 | 72 28 77 6f 72 64 5b 69 | putcha|r(word[i|
|00000960| 2b 2b 5d 29 3b 0a 0a 20 | 20 52 65 6d 65 6d 62 65 |++]);.. | Remembe|
|00000970| 72 20 74 68 61 74 20 49 | 20 73 65 74 20 74 68 65 |r that I| set the|
|00000980| 20 65 6c 65 6d 65 6e 74 | 20 61 66 74 65 72 20 74 | element| after t|
|00000990| 68 65 20 75 73 65 72 27 | 73 20 6c 61 73 74 20 69 |he user'|s last i|
|000009a0| 6e 70 75 74 20 27 5c 30 | 27 20 77 68 69 63 68 20 |nput '\0|' which |
|000009b0| 0a 65 76 61 6c 75 61 74 | 65 73 20 74 6f 20 30 2e |.evaluat|es to 0.|
|000009c0| 20 20 54 68 65 20 77 68 | 69 6c 65 20 6c 6f 6f 70 | The wh|ile loop|
|000009d0| 20 77 69 6c 6c 20 63 6f | 6e 74 69 6e 75 65 20 75 | will co|ntinue u|
|000009e0| 6e 74 69 6c 20 77 6f 72 | 64 5b 69 5d 20 69 73 20 |ntil wor|d[i] is |
|000009f0| 30 2e 20 20 0a 46 69 6e | 61 6c 6c 79 2c 20 73 69 |0. .Fin|ally, si|
|00000a00| 6e 63 65 20 6d 61 69 6e | 28 29 20 72 65 74 75 72 |nce main|() retur|
|00000a10| 6e 73 20 69 6e 74 2c 20 | 61 64 64 0a 0a 20 20 72 |ns int, |add.. r|
|00000a20| 65 74 75 72 6e 20 30 3b | 0a 0a 62 65 66 6f 72 65 |eturn 0;|..before|
|00000a30| 20 74 68 65 20 66 69 6e | 61 6c 20 63 6c 6f 73 69 | the fin|al closi|
|00000a40| 6e 67 20 62 72 61 63 65 | 20 74 6f 20 72 65 74 75 |ng brace| to retu|
|00000a50| 72 6e 20 61 20 22 70 72 | 6f 67 72 61 6d 20 63 6f |rn a "pr|ogram co|
|00000a60| 6d 70 6c 65 74 65 64 20 | 0a 73 75 63 63 65 73 73 |mpleted |.success|
|00000a70| 66 75 6c 6c 79 22 20 63 | 6f 64 65 20 74 6f 20 74 |fully" c|ode to t|
|00000a80| 68 65 20 4f 53 2e 0a 0a | 3e 20 70 73 3a 20 69 73 |he OS...|> ps: is|
|00000a90| 20 74 68 65 72 65 20 61 | 20 77 61 79 20 74 6f 20 | there a| way to |
|00000aa0| 66 69 6e 64 20 6f 75 74 | 20 77 68 61 74 20 65 78 |find out| what ex|
|00000ab0| 61 63 74 6c 79 20 65 72 | 72 6f 72 20 6d 65 73 73 |actly er|ror mess|
|00000ac0| 61 67 65 73 20 6d 65 61 | 6e 3f 20 20 49 20 6b 65 |ages mea|n? I ke|
|00000ad0| 70 74 0a 3e 20 67 65 74 | 74 69 6e 67 20 73 6f 6d |pt.> get|ting som|
|00000ae0| 65 74 68 69 6e 67 20 73 | 69 6d 69 6c 61 72 20 74 |ething s|imilar t|
|00000af0| 6f 3a 20 6e 6f 74 20 61 | 6e 20 49 76 61 6c 75 65 |o: not a|n Ivalue|
|00000b00| 2e 20 20 49 74 20 77 6f | 75 6c 64 20 62 65 20 6e |. It wo|uld be n|
|00000b10| 69 63 65 20 69 66 20 49 | 20 6b 6e 65 77 0a 3e 20 |ice if I| knew.> |
|00000b20| 77 68 61 74 20 74 68 65 | 20 68 65 6c 6c 20 74 68 |what the| hell th|
|00000b30| 61 74 20 6d 65 61 6e 74 | 2e 0a 0a 20 20 49 74 27 |at meant|... It'|
|00000b40| 73 20 74 65 6c 6c 69 6e | 67 20 79 6f 75 20 74 68 |s tellin|g you th|
|00000b50| 61 74 20 77 6f 72 64 20 | 69 73 20 6e 6f 74 20 61 |at word |is not a|
|00000b60| 6e 20 6c 76 61 6c 75 65 | 2e 20 20 57 68 61 74 20 |n lvalue|. What |
|00000b70| 74 68 69 73 20 6d 65 61 | 6e 73 20 69 73 3a 20 20 |this mea|ns is: |
|00000b80| 49 6e 20 0a 43 20 61 73 | 73 69 67 6e 6d 65 6e 74 |In .C as|signment|
|00000b90| 20 65 78 70 72 65 73 73 | 69 6f 6e 73 20 74 68 65 | express|ions the|
|00000ba0| 20 76 61 6c 75 65 20 6f | 6e 20 74 68 65 20 6c 65 | value o|n the le|
|00000bb0| 66 74 20 73 69 64 65 20 | 6f 66 20 74 68 65 20 61 |ft side |of the a|
|00000bc0| 73 73 69 67 6e 6d 65 6e | 74 20 0a 6f 70 65 72 61 |ssignmen|t .opera|
|00000bd0| 74 6f 72 20 28 74 68 65 | 20 27 6c 65 66 74 20 76 |tor (the| 'left v|
|00000be0| 61 6c 75 65 27 20 6f 72 | 20 27 6c 76 61 6c 75 65 |alue' or| 'lvalue|
|00000bf0| 27 29 20 69 73 20 6c 69 | 6d 69 74 65 64 20 74 6f |') is li|mited to|
|00000c00| 20 61 20 68 61 6e 64 66 | 75 6c 20 6f 66 20 0a 70 | a handf|ul of .p|
|00000c10| 6f 73 73 69 62 6c 65 20 | 76 61 6c 75 65 73 3a 20 |ossible |values: |
|00000c20| 73 69 6d 70 6c 65 20 76 | 61 72 69 61 62 6c 65 73 |simple v|ariables|
|00000c30| 20 28 65 67 20 69 6e 74 | 2c 20 63 68 61 72 2c 20 | (eg int|, char, |
|00000c40| 66 6c 6f 61 74 29 20 74 | 68 61 74 20 61 72 65 6e |float) t|hat aren|
|00000c50| 27 74 20 0a 64 65 63 6c | 61 72 65 64 20 63 6f 6e |'t .decl|ared con|
|00000c60| 73 74 2c 20 61 6e 64 20 | 70 6f 69 6e 74 65 72 73 |st, and |pointers|
|00000c70| 2e 20 20 41 72 72 61 79 | 73 2c 20 63 6f 6e 73 74 |. Array|s, const|
|00000c80| 20 76 61 72 69 61 62 6c | 65 73 20 61 6e 64 20 63 | variabl|es and c|
|00000c90| 6f 6e 73 74 61 6e 74 73 | 20 0a 63 61 6e 6e 6f 74 |onstants| .cannot|
|00000ca0| 20 62 65 20 6c 76 61 6c | 75 65 73 2e 20 20 41 63 | be lval|ues. Ac|
|00000cb0| 74 75 61 6c 6c 79 20 74 | 68 69 73 20 6c 61 6e 67 |tually t|his lang|
|00000cc0| 75 61 67 65 20 69 73 20 | 61 20 6c 69 74 74 6c 65 |uage is |a little|
|00000cd0| 20 6c 6f 6f 73 65 20 2d | 2d 20 73 74 72 69 63 74 | loose -|- strict|
|00000ce0| 6c 79 20 0a 73 70 65 61 | 6b 69 6e 67 20 49 20 28 |ly .spea|king I (|
|00000cf0| 61 6e 64 20 79 6f 75 72 | 20 63 6f 6d 70 69 6c 65 |and your| compile|
|00000d00| 72 29 20 73 68 6f 75 6c | 64 20 62 65 20 74 61 6c |r) shoul|d be tal|
|00000d10| 6b 69 6e 67 20 61 62 6f | 75 74 20 22 6d 6f 64 69 |king abo|ut "modi|
|00000d20| 66 69 61 62 6c 65 20 0a | 6c 76 61 6c 75 65 73 22 |fiable .|lvalues"|
|00000d30| 20 69 6e 20 74 68 69 73 | 20 63 6f 6e 74 65 78 74 | in this| context|
|00000d40| 2e 20 20 54 68 65 20 73 | 69 6d 70 6c 65 73 74 20 |. The s|implest |
|00000d50| 74 68 69 6e 67 20 74 6f | 20 72 65 6d 65 6d 62 65 |thing to| remembe|
|00000d60| 72 20 69 73 20 69 66 20 | 79 6f 75 20 75 73 65 20 |r is if |you use |
|00000d70| 0a 61 6e 20 61 72 72 61 | 79 20 75 73 65 20 69 74 |.an arra|y use it|
|00000d80| 20 6c 69 6b 65 20 61 6e | 20 61 72 72 61 79 20 28 | like an| array (|
|00000d90| 73 75 62 73 63 72 69 70 | 74 69 6e 67 20 77 69 74 |subscrip|ting wit|
|00000da0| 68 20 5b 5d 29 20 61 6e | 64 20 69 66 20 79 6f 75 |h []) an|d if you|
|00000db0| 20 68 61 76 65 20 61 20 | 0a 70 6f 69 6e 74 65 72 | have a |.pointer|
|00000dc0| 2c 20 75 73 65 20 69 74 | 20 6c 69 6b 65 20 61 20 |, use it| like a |
|00000dd0| 70 6f 69 6e 74 65 72 20 | 28 64 65 72 65 66 65 72 |pointer |(derefer|
|00000de0| 65 6e 63 69 6e 67 20 77 | 69 74 68 20 2a 29 2e 20 |encing w|ith *). |
|00000df0| 20 55 6e 74 69 6c 20 79 | 6f 75 20 61 72 65 20 0a | Until y|ou are .|
|00000e00| 66 61 6d 69 6c 69 61 72 | 20 77 69 74 68 20 74 68 |familiar| with th|
|00000e10| 65 20 73 75 62 74 6c 65 | 74 69 65 73 20 6f 66 20 |e subtle|ties of |
|00000e20| 61 72 72 61 79 73 20 64 | 65 63 61 79 69 6e 67 20 |arrays d|ecaying |
|00000e30| 69 6e 74 6f 20 70 6f 69 | 6e 74 65 72 73 20 61 6e |into poi|nters an|
|00000e40| 64 20 73 75 63 68 20 0a | 74 68 69 6e 67 73 20 69 |d such .|things i|
|00000e50| 74 27 73 20 61 20 73 69 | 6d 70 6c 65 2c 20 73 74 |t's a si|mple, st|
|00000e60| 72 61 69 67 68 74 66 6f | 72 77 61 72 64 20 67 75 |raightfo|rward gu|
|00000e70| 69 64 65 6c 69 6e 65 2e | 0a 0a 20 20 53 69 6e 63 |ideline.|.. Sinc|
|00000e80| 65 20 49 20 68 61 76 65 | 20 61 20 6e 61 67 67 69 |e I have| a naggi|
|00000e90| 6e 67 20 66 65 65 6c 69 | 6e 67 20 74 68 61 74 20 |ng feeli|ng that |
|00000ea0| 74 68 69 73 20 77 61 73 | 6e 27 74 20 74 68 65 20 |this was|n't the |
|00000eb0| 63 6c 65 61 72 65 73 74 | 20 70 6f 73 74 20 6f 6e |clearest| post on|
|00000ec0| 20 0a 45 61 72 74 68 2c | 20 49 20 68 69 67 68 6c | .Earth,| I highl|
|00000ed0| 79 20 72 65 63 6f 6d 6d | 65 6e 64 20 61 63 71 75 |y recomm|end acqu|
|00000ee0| 69 72 69 6e 67 20 61 6e | 64 20 72 65 61 64 69 6e |iring an|d readin|
|00000ef0| 67 20 74 68 65 20 46 41 | 51 20 66 6f 72 20 74 68 |g the FA|Q for th|
|00000f00| 69 73 20 0a 6e 65 77 73 | 67 72 6f 75 70 2e 20 20 |is .news|group. |
|00000f10| 49 74 20 64 69 73 63 75 | 73 73 65 73 20 70 6f 69 |It discu|sses poi|
|00000f20| 6e 74 65 72 73 20 61 6e | 64 20 61 72 72 61 79 73 |nters an|d arrays|
|00000f30| 20 61 6e 64 20 6c 76 61 | 6c 75 65 73 20 61 74 20 | and lva|lues at |
|00000f40| 67 72 65 61 74 20 6c 65 | 6e 67 74 68 2e 20 20 0a |great le|ngth. .|
|00000f50| 54 68 65 20 46 41 51 20 | 69 73 20 61 76 61 69 6c |The FAQ |is avail|
|00000f60| 61 62 6c 65 20 76 69 61 | 20 61 6e 6f 6e 79 6d 6f |able via| anonymo|
|00000f70| 75 73 20 66 74 70 20 66 | 72 6f 6d 20 72 74 66 6d |us ftp f|rom rtfm|
|00000f80| 2e 6d 69 74 2e 65 64 75 | 20 69 6e 20 74 68 65 20 |.mit.edu| in the |
|00000f90| 64 69 72 65 63 74 6f 72 | 79 20 0a 2f 70 75 62 2f |director|y ./pub/|
|00000fa0| 75 73 65 6e 65 74 2d 62 | 79 2d 67 72 6f 75 70 2f |usenet-b|y-group/|
|00000fb0| 63 6f 6d 70 2e 6c 61 6e | 67 2e 63 2f 43 2d 46 41 |comp.lan|g.c/C-FA|
|00000fc0| 51 2d 4c 49 53 2e 0a 0a | 20 20 47 6f 6f 64 20 6c |Q-LIS...| Good l|
|00000fd0| 75 63 6b 21 0a 0a 2f 2a | 2a 4a 61 6d 65 73 20 52 |uck!../*|*James R|
|00000fe0| 6f 62 69 6e 73 6f 6e 2a | 2a 2a 2a 2a 2a 2a 2a 2a |obinson*|********|
|00000ff0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 20 20 |********|****** |
|00001000| 20 20 20 20 20 20 20 20 | 20 20 0a 20 20 22 49 66 | | . "If|
|00001010| 20 61 20 66 61 74 61 6c | 20 65 72 72 6f 72 20 6f | a fatal| error o|
|00001020| 63 63 75 72 73 2c 20 74 | 68 65 20 70 72 6f 67 72 |ccurs, t|he progr|
|00001030| 61 6d 20 73 68 6f 75 6c | 64 20 6e 6f 74 20 62 65 |am shoul|d not be|
|00001040| 20 61 6c 6c 6f 77 65 64 | 20 74 6f 20 63 6f 6e 74 | allowed| to cont|
|00001050| 69 6e 75 65 2e 22 0a 20 | 2d 2d 20 4f 72 61 63 6c |inue.". |-- Oracl|
|00001060| 65 20 50 72 6f 2a 43 20 | 55 73 65 72 27 73 20 47 |e Pro*C |User's G|
|00001070| 75 69 64 65 20 20 20 20 | 20 20 20 20 20 2a 2a 2a |uide | ***|
|00001080| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 6a 61 6d 65 73 2d |********|**james-|
|00001090| 72 6f 62 69 6e 73 6f 6e | 40 75 69 6f 77 61 2e 65 |robinson|@uiowa.e|
|000010a0| 64 75 2a 2a 2f 0a | |du**/. | |
+--------+-------------------------+-------------------------+--------+--------+